Skip to main content

Redeeming a gift card

Details

URL : <base_url>/giftcards/redeem/{gift_card_code}

Method : POST

Authentication required : YES

Post body type: Form Data

Request parameters

In the request URL, provide the following parameters in the body of the request.

ParameterTypeExampleDescription
amountnumeric99.99Amount to redeem, can be null if type id full.
typestringpartial or fullTells the system how to redeem this gift card.
reference_numberstring773737ASDDnullableAssigns a reference number at redemption time.
cashier_pininteger12345Pin of the current cashier
card_pininteger12345Only required if pin_required attribute is true

Success Response

Code : 200 OK

Content :

{
"success": true,
"has_reference_number": true,
"activity_id": 123
}
{
"success": true,
"has_reference_number": false,
"activity_id": 123
}

Error Responses

Condition : Incorrect code.

Code : 400 BAD REQUEST

Content :

{
"message": "The given data was invalid.",
"errors": {
"code": "The provided code is incorrect"
}
}

Condition : no balance.

Code : 400 BAD REQUEST

Content :

{
"message": "The given data was invalid.",
"errors": {
"amount": "gift card with code XXXXXX has no balance"
}
}

Condition : Amount too large.

Code : 400 BAD REQUEST

Content :

{
"message": "The given data was invalid.",
"errors": {
"amount": "Please enter an amount less than or equal to 950"
}
}

Condition : Inactive.

Code : 400 BAD REQUEST

Content :

{
"message": "The given data was invalid.",
"errors": {
"code": "Inactive gift card with code: XXXXX"
}
}

Condition : expired.

Code : 400 BAD REQUEST

Content :

{
"message": "The given data was invalid.",
"errors": {
"code": "Expired gift card with code: XXXXX"
}
}